package cis.view;

import java.awt.Color;

public class Slice {
	/** The starting angle for this pie slice. */
	private float startAngle;
	/** The angular measure for this slice of the pie chart. */
	private float angle;
	/** The color of this pie slice. */
	private Color color;
	/** Acquires the key text representation for this slice. */
	private String keyString;
	
	/**
	 * <p>
	 * This is the only constructor that will assign the necessary values to the
	 * global values.
	 * </p>
	 * 
	 * @param startAngle The starting angle for this slice.
	 * @param angle The angular measure for this slice.
	 * @param color	The color of this slice.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>startAngle</code>, <code>angle</code> and 
	 *           <code>color</code> must be initialized.</dd>
	 * <dd>POST: <code>startAngle</code>, <code>angle</code> and 
	 *           <code>color</code> are assigned the values passed.</dd>
	 * </dt>
	 */
	public Slice(float startAngle, float angle, Color color, String keyString) {
		this.startAngle = startAngle;
		this.angle      = angle;
		this.color      = color;
		this.keyString  = keyString;
	}	// end constructor
	
	/**
	 * <p>
	 * Assigns the value passed by the method to <code>startAngle</code>.
	 * </p>
	 * 
	 * @param startAngle The starting angle for this slice.
	 *                   
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>startAngle</code> must be initialized.</dd>
	 * <dd>POST: <code>startAngle</code> is assigned to the value passed by the 
	 *           method.</dd>
	 * </dt>
	 */
	public void setStartAngle(float startAngle) {
		this.startAngle = startAngle;
	}	// end method
	
	/**
	 * <p>
	 * Assigns the value passed by the method to <code>angle</code>.
	 * </p>
	 * 
	 * @param angle The angular measure of this slice.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>angle</code> must be initialized.</dd>
	 * <dd>POST: <code>angle</code> is assigned to the value passed by the
	 *           method.</dd>
	 * </dt>
	 */
	public void setAngle(float angle) {
		this.angle = angle;
	}	// end method
	
	/**
	 * <p>
	 * Assigns the value passed by the method to <code>color</code>.
	 * </p>
	 * 
	 * @param color The color of this slice.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>color</code> must be initialized.</dd>
	 * <dd>POST: <code>color</code> is assigned to the value passed by the 
	 *           method.</dd>
	 * </dt>
	 */
	public void setColor(Color color) {
		this.color = color;
	}	// end method
	
	/**
	 * <p>
	 * Acquires the start angle for this pie slice.
	 * </p>
	 * 
	 * @return The value stored in <code>startAngle</code>.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>startAngle</code> must be assigned a value.</dd>
	 * <dd>POST: The value stored by <code>startAngle</code> is returned to the 
	 *           requester.</dd>
	 * </dt>
	 */
	public float getStartAngle() {
		return this.startAngle;
	}	// end method
	
	/**
	 * <p>
	 * Acquires the angular measurement for this slice.
	 * </p>
	 * 
	 * @return The value stored in <code>angle</code>.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>angle</code> must be assigned a value.</dd>
	 * <dd>POST: The value stored by <code>angle</code> is returned to the 
	 *           requester.</dd>
	 * </dt>
	 */
	public float getAngle() {
		return this.angle;
	}	// end method
	
	/**
	 * <p>
	 * Acquires the color for this slice.
	 * </p>
	 * 
	 * @return The value stored in <code>color</code>.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>color</code> must be assigned a value.</dd>
	 * <dd>POST: The value stored by <code>color</code> is returned to the 
	 *           requester.</dd>
	 * </dt>
	 */
	public Color getColor() {
		return this.color;
	}	// end method
	
	/**
	 * <p>
	 * Acquires the string representation for this slice that will be used in 
	 * the color key.
	 * </p>
	 * 
	 * @return The value stored in <code>keyString</code>.
	 * 
	 * <dt><b>Conditions:</b>
	 * <dd>PRE:  <code>keyString</code> must be assigned a value.</dd>
	 * <dd>POST: The value contained in <code>keyString</code> is returned to 
	 *           the requester.</dd>
	 * </dt>
	 */
	public String getKeyString() {
		return this.keyString;
	}	// end method
}	// end class